package com.heima.datasync.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 先从 article数据库中 article与config表 关联查询
 * 查询所有的 发布文章( is_delete != 1    is_down != 1) 的article表中所有信息
 * ap_article   ap_article_confg
 * @return ApArticle list
 */
@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {
    @Select("select aa.* from ap_article aa left join ap_article_config aac " +
            "on aa.id = aac.article_id where aac.is_delete != 1 and aac.is_down != 1")
    List<ApArticle> findAllArticles();
}
